/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * LabelDialogPane.java
 *
 * Created on 27-ene-2010, 12:46:10
 */

package geobloc.desktop.dialogs;

import java.util.Vector;

/**
 *
 * @author Usuario
 */
public class ButtonDialogPane extends javax.swing.JPanel {

    /** Creates new form LabelDialogPane */
    public ButtonDialogPane() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        actionButtonGroup = new javax.swing.ButtonGroup();
        textLabel = new javax.swing.JLabel();
        textTextField = new javax.swing.JTextField();
        descriptionLabel = new javax.swing.JLabel();
        descriptionScrollPane = new javax.swing.JScrollPane();
        descriptionTextArea = new javax.swing.JTextArea();
        idLabel = new javax.swing.JLabel();
        idTextField = new javax.swing.JTextField();
        actionLabel = new javax.swing.JLabel();
        mapActionRadioButton = new javax.swing.JRadioButton();
        gpsActionRadioButton = new javax.swing.JRadioButton();
        photoActionRadioButton = new javax.swing.JRadioButton();
        videoActionRadioButton = new javax.swing.JRadioButton();
        audioActionRadioButton = new javax.swing.JRadioButton();

        setName("Form"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(geobloc.desktop.FormDesignerApp.class).getContext().getResourceMap(ButtonDialogPane.class);
        textLabel.setText(resourceMap.getString("textLabel.text")); // NOI18N
        textLabel.setName("textLabel"); // NOI18N

        textTextField.setText(resourceMap.getString("textTextField.text")); // NOI18N
        textTextField.setName("textTextField"); // NOI18N

        descriptionLabel.setText(resourceMap.getString("descriptionLabel.text")); // NOI18N
        descriptionLabel.setName("descriptionLabel"); // NOI18N

        descriptionScrollPane.setName("descriptionScrollPane"); // NOI18N

        descriptionTextArea.setColumns(20);
        descriptionTextArea.setFont(resourceMap.getFont("descriptionTextArea.font")); // NOI18N
        descriptionTextArea.setLineWrap(true);
        descriptionTextArea.setRows(3);
        descriptionTextArea.setName("descriptionTextArea"); // NOI18N
        descriptionScrollPane.setViewportView(descriptionTextArea);

        idLabel.setText(resourceMap.getString("idLabel.text")); // NOI18N
        idLabel.setName("idLabel"); // NOI18N

        idTextField.setName("idTextField"); // NOI18N

        actionLabel.setText(resourceMap.getString("actionLabel.text")); // NOI18N
        actionLabel.setName("actionLabel"); // NOI18N

        actionButtonGroup.add(mapActionRadioButton);
        mapActionRadioButton.setSelected(true);
        mapActionRadioButton.setText(resourceMap.getString("mapActionRadioButton.text")); // NOI18N
        mapActionRadioButton.setActionCommand(resourceMap.getString("mapActionRadioButton.actionCommand")); // NOI18N
        mapActionRadioButton.setName("mapActionRadioButton"); // NOI18N

        actionButtonGroup.add(gpsActionRadioButton);
        gpsActionRadioButton.setText(resourceMap.getString("gpsActionRadioButton.text")); // NOI18N
        gpsActionRadioButton.setActionCommand(resourceMap.getString("gpsActionRadioButton.actionCommand")); // NOI18N
        gpsActionRadioButton.setName("gpsActionRadioButton"); // NOI18N

        actionButtonGroup.add(photoActionRadioButton);
        photoActionRadioButton.setText(resourceMap.getString("photoActionRadioButton.text")); // NOI18N
        photoActionRadioButton.setActionCommand(resourceMap.getString("photoActionRadioButton.actionCommand")); // NOI18N
        photoActionRadioButton.setName("photoActionRadioButton"); // NOI18N

        actionButtonGroup.add(videoActionRadioButton);
        videoActionRadioButton.setText(resourceMap.getString("videoActionRadioButton.text")); // NOI18N
        videoActionRadioButton.setActionCommand(resourceMap.getString("videoActionRadioButton.actionCommand")); // NOI18N
        videoActionRadioButton.setName("videoActionRadioButton"); // NOI18N

        actionButtonGroup.add(audioActionRadioButton);
        audioActionRadioButton.setText(resourceMap.getString("audioActionRadioButton.text")); // NOI18N
        audioActionRadioButton.setActionCommand(resourceMap.getString("audioActionRadioButton.actionCommand")); // NOI18N
        audioActionRadioButton.setName("audioActionRadioButton"); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(textLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(textTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(idLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(idTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(layout.createSequentialGroup()
                .addComponent(mapActionRadioButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(gpsActionRadioButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(photoActionRadioButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(videoActionRadioButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(audioActionRadioButton))
            .addComponent(actionLabel)
            .addComponent(descriptionScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 324, Short.MAX_VALUE)
            .addComponent(descriptionLabel)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textLabel)
                    .addComponent(textTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(idLabel)
                    .addComponent(idTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(actionLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(mapActionRadioButton)
                    .addComponent(gpsActionRadioButton)
                    .addComponent(photoActionRadioButton)
                    .addComponent(videoActionRadioButton)
                    .addComponent(audioActionRadioButton))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(descriptionLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(descriptionScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
    }// </editor-fold>//GEN-END:initComponents

    public Vector<String> getResults() {
        Vector<String> results = new Vector<String>();
        // Add the element ID
        results.add(idTextField.getText());
        // Add the description or null if it wasn't written
        if (descriptionTextArea.getText().isEmpty())
            results.add(null);
        else
            results.add(descriptionTextArea.getText());
        // Add the button text
        results.add(textTextField.getText());
        // Add the choosen action
        results.add(actionButtonGroup.getSelection().getActionCommand());
        return results;
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup actionButtonGroup;
    private javax.swing.JLabel actionLabel;
    private javax.swing.JRadioButton audioActionRadioButton;
    private javax.swing.JLabel descriptionLabel;
    private javax.swing.JScrollPane descriptionScrollPane;
    private javax.swing.JTextArea descriptionTextArea;
    private javax.swing.JRadioButton gpsActionRadioButton;
    private javax.swing.JLabel idLabel;
    private javax.swing.JTextField idTextField;
    private javax.swing.JRadioButton mapActionRadioButton;
    private javax.swing.JRadioButton photoActionRadioButton;
    private javax.swing.JLabel textLabel;
    private javax.swing.JTextField textTextField;
    private javax.swing.JRadioButton videoActionRadioButton;
    // End of variables declaration//GEN-END:variables

}
